﻿namespace ACCOUNTING.LVY.Business
{
    using ACCOUNTING;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Data;
    using System.Windows.Forms;

    public class clsThanhToanTheoMatHangChiTiet
    {
        private string mHanSuDung = "";
        private string mKhoaChiTiet = "";
        private string mKhoaHangHoa = "";
        private string mKhoaPhieuThanhToan = "";
        private string mKhoaPhieuXuat = "";
        private string mNgayThanhToan = "";
        private string mSoLoHang = "";
        private double mSoLuongThuTien = 0.0;
        private string mSoSeri = "";
        private double mTriGiaThuTien = 0.0;
        private double mTriGiaThuTienNT = 0.0;

        public bool Save()
        {
            bool flag=false;
            IDataParameter[] commandParameters = new IDataParameter[11];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@KhoaChiTiet", DbType.Int64, ParameterDirection.Input, this.mKhoaChiTiet);
                commandParameters[1] = DBHelper.createParameter("@KhoaPhieuThanhToan", DbType.Int64, ParameterDirection.Input, this.mKhoaPhieuThanhToan);
                commandParameters[2] = DBHelper.createParameter("@KhoaPhieuXuat", DbType.Int64, ParameterDirection.Input, this.mKhoaPhieuXuat);
                commandParameters[3] = DBHelper.createParameter("@NgayThanhToan", DbType.Int64, ParameterDirection.Input, this.mNgayThanhToan);
                commandParameters[4] = DBHelper.createParameter("@KhoaHangHoa", DbType.Int64, ParameterDirection.Input, this.mKhoaHangHoa);
                commandParameters[5] = DBHelper.createParameter("@SoLoHang", DbType.Int64, ParameterDirection.Input, this.mSoLoHang);
                commandParameters[6] = DBHelper.createParameter("@HanSuDung", DbType.Int64, ParameterDirection.Input, this.mHanSuDung);
                commandParameters[7] = DBHelper.createParameter("@SoSeri", DbType.Int64, ParameterDirection.Input, this.mSoSeri);
                commandParameters[8] = DBHelper.createParameter("@SoLuongThuTien", DbType.Date, ParameterDirection.Input, this.mSoLuongThuTien);
                commandParameters[9] = DBHelper.createParameter("@TriGiaThuTienNT", DbType.Date, ParameterDirection.Input, this.mTriGiaThuTienNT);
                commandParameters[10] = DBHelper.createParameter("@TriGiaThuTien", DbType.Date, ParameterDirection.Input, this.mTriGiaThuTien);
                DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.StoredProcedure, "BH_sp_ThanhToanTheoMatHangChiTiet", commandParameters);
                flag = true;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                flag = false;
                ProjectData.ClearProjectError();
                return flag;
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        public string HanSuDung
        {
            get
            {
                return this.mHanSuDung;
            }
            set
            {
                this.mHanSuDung = value;
            }
        }

        public string KhoaChiTiet
        {
            get
            {
                return this.mKhoaChiTiet;
            }
            set
            {
                this.mKhoaChiTiet = value;
            }
        }

        public string KhoaHangHoa
        {
            get
            {
                return this.mKhoaHangHoa;
            }
            set
            {
                this.mKhoaHangHoa = value;
            }
        }

        public string KhoaPhieuThanhToan
        {
            get
            {
                return this.mKhoaPhieuThanhToan;
            }
            set
            {
                this.mKhoaPhieuThanhToan = value;
            }
        }

        public string KhoaPhieuXuat
        {
            get
            {
                return this.mKhoaPhieuXuat;
            }
            set
            {
                this.mKhoaPhieuXuat = value;
            }
        }

        public string NgayThanhToan
        {
            get
            {
                return this.mNgayThanhToan;
            }
            set
            {
                this.mNgayThanhToan = value;
            }
        }

        public string SoLoHang
        {
            get
            {
                return this.mSoLoHang;
            }
            set
            {
                this.mSoLoHang = value;
            }
        }

        public double SoLuongThuTien
        {
            get
            {
                return this.mSoLuongThuTien;
            }
            set
            {
                this.mSoLuongThuTien = value;
            }
        }

        public string SoSeri
        {
            get
            {
                return this.mSoSeri;
            }
            set
            {
                this.mSoSeri = value;
            }
        }

        public double TriGiaThuTien
        {
            get
            {
                return this.mTriGiaThuTien;
            }
            set
            {
                this.mTriGiaThuTien = value;
            }
        }

        public double TriGiaThuTienNT
        {
            get
            {
                return this.mTriGiaThuTienNT;
            }
            set
            {
                this.mTriGiaThuTienNT = value;
            }
        }
    }
}

